package com.jiang.daily.Q3019;

/**
 * @author Jiang
 * @version 1.0
 * @date 2025/01/07 0:41
 */
class Solution {
    public int countKeyChanges(String s) {
        char[] array = s.toCharArray();
        int res = 0;
        for (int i = 1; i < array.length; i++) {
            // if (array[i] != array[i - 1] && Math.abs(array[i] - array[i - 1]) != 32) res++;
            if ((array[i] - 'A' & 31) != (array[i - 1] - 'A' & 31)) res++;
        }
        return res;
    }
}
